package com.li.designpattern.filter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Test {
	public static void main(String[] args) {
		List<Person> list=new ArrayList<Person>();
		list.add(new Person("li","男",23,"single"));
		list.add(new Person("li2","男",24,"single"));
		list.add(new Person("li3","女",25,"single"));
		list.add(new Person("li4","女",23,"single"));
		list.add(new Person("li5","男",25,"single"));
		
		Criteria<Person> manCriteria=new ManCriteria();
		List<Person> manList=manCriteria.meetCriteria(list);
		System.out.println(manList);
		
		Criteria<Person> ageCriteria=new AgeCriteria();
		List<Person> ageList=ageCriteria.meetCriteria(list);
		System.out.println(ageList);
	}
}
